FROM openjdk:8-jre
ARG JAR_NAME=jdemo-0.0.1-SNAPSHOT.jar
RUN rm -f /etc/localtime \
 && ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
 && echo "Asia/Shanghai" > /etc/timezone
ADD . /java/src/app
WORKDIR /java/src/app
RUN cp /java/src/app/target/${JAR_NAME} /tmp/target.jar \
 && rm -rf /java/src/app
EXPOSE 8080
ENTRYPOINT ["java","-jar","/tmp/target.jar"]